package org.itboys.rpc.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.itboys.dto.Category;
import org.itboys.dto.base.Result;
import org.itboys.rpc.service.BaseRpcService;
import org.itboys.rpc.service.category.RpcProductCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 商品分类
 * @author weisky
 *
 */
@Controller
@RequestMapping(value = "/rpc/category")
public class RpcProductCategoryController extends BaseRpcService{

	@Autowired
	private RpcProductCategoryService rpcProductCategoryService;
	
	/**
     * 获取所有的分类
     * 备注：建材标局只有一级分类  所以获取的所有分类，其实只有父类
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/getAllCategory")
    public  Result<List<Category>> getAllCategory(HttpServletRequest request,HttpServletResponse response){
        return rpcProductCategoryService.getAllCategory();
    }
}
